/*
 * @(#)Register.java	2008/07/28
 *
 * Copyright 2008 Web & Zen Multimedia, All rights reserved.
 * Use is subject to license terms.
 */
package it.wzm.common.lightweightlog.client;

import java.util.LinkedList;
import java.util.Properties;

/**
 * Where all our Dumper will be stored, all extending classes are asked to implement few methods.
 */
abstract class Register<T extends Dumper> {
    
    /**
     * The status of this Register
     */
    enum Status {
        INIT,
        OPEN,
        FULL,
        FAILURE,
    }
    
    /**
     * Constructor
     * @param p
     * @param d
     */
    public Register(Properties p, Dumper[] d) {    	
    }
    
    /**
     * Size of this register
     * @return int
     */
    abstract int size();
    
    /**
     * Save dumper to slot
     * @param t extended Dumper
     * @return true if this Dumper is properly saved
     */
    abstract boolean save(T t);

    /**
     * Remove dumper from slot
     * @param t extended Dumper
     * @return true if this Dumper is properly saved
     */
    abstract boolean remove(T t);
    
    /**
     * Dispatch a list of entry to each dumper in this register
     * @param ll A LinkedList of Entry
     */
    abstract <E extends Entry> void dispatchToDumper(LinkedList<E> ll);
    
    /**
     * Dispatch an entry to each dumper in this register
     * @param e Any extended Entry
     */
    abstract <E extends Entry> void dispatchToDumper(E e);
}